package com.exam.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author 小聋包
 * @Date 2024/4/16 19:20
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("考试实体")
@TableName(value = "exam")
public class Exam implements Serializable {

    //不需要 主键自增 id type 后面需要手动配置id
    @TableId
    @ApiModelProperty(value = "主键 考试id",example = "1")
    private Integer examId;

    @ApiModelProperty(value = "考试名称",example = "小学一年级考试")
    private  String examName;

    @ApiModelProperty(value = "考试描述",example = "这是一场考试描述")
    private String examDesc;

    @ApiModelProperty(value = "考试类型1公开，2需要密码",example = "1")
    private Integer type;

    @ApiModelProperty(value = "考试密码 当type=2的时候存在",example = "12345")
    private  String password;

    @ApiModelProperty(value = "考试时间",example = "123(分钟)")
    private  Integer duration;

    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "考试开始时间",example = "2024-04-16")
    @TableField(strategy = FieldStrategy.IGNORED)
    private Date startTime;

    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "考试结束时间",example = "2025-04-16")
    @TableField(strategy = FieldStrategy.IGNORED)
    private Date endTime;

    @ApiModelProperty(value = "考试总分",example = "100")
    private Integer totalScore;

    @ApiModelProperty(value = "考试及格线",example = "60")
    private Integer passScore;

    @ApiModelProperty(value = "考试状态 1有效 2无效",example = "1")
    private Integer status;
}
